//
// CTextureDLM.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;
import org.ryzom.nel.misc.IStream;

public class CTextureDLM extends ITexture {
  private long swigCPtr;

  public CTextureDLM(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CTextureDLM_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTextureDLM obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTextureDLM(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CTextureDLM(long width, long height) {
    this(nel3dJNI.new_CTextureDLM__SWIG_0(width, height), true);
  }

  public void doGenerate(boolean arg0) {
    nel3dJNI.CTextureDLM_doGenerate__SWIG_0(swigCPtr, this, arg0);
  }

  public void doGenerate() {
    nel3dJNI.CTextureDLM_doGenerate__SWIG_1(swigCPtr, this);
  }

  public CTextureDLM() {
    this(nel3dJNI.new_CTextureDLM__SWIG_1(), true);
  }

  public void serial(IStream arg0) {
    nel3dJNI.CTextureDLM_serial(swigCPtr, this, IStream.getCPtr(arg0), arg0);
  }

  public boolean canCreateLightMap(long w, long h) {
    return nel3dJNI.CTextureDLM_canCreateLightMap(swigCPtr, this, w, h);
  }

  public boolean createLightMap(long w, long h, SWIGTYPE_p_unsigned_int x, SWIGTYPE_p_unsigned_int y) {
    return nel3dJNI.CTextureDLM_createLightMap(swigCPtr, this, w, h, SWIGTYPE_p_unsigned_int.getCPtr(x), SWIGTYPE_p_unsigned_int.getCPtr(y));
  }

  public void copyRect(long x, long y, long w, long h, CRGBA textMap) {
    nel3dJNI.CTextureDLM_copyRect(swigCPtr, this, x, y, w, h, CRGBA.getCPtr(textMap), textMap);
  }

  public void fillRect(long x, long y, long w, long h, short value) {
    nel3dJNI.CTextureDLM_fillRect(swigCPtr, this, x, y, w, h, value);
  }

  public void modulateAndfillRect565(long x, long y, long w, long h, CRGBA textMap, SWIGTYPE_p_unsigned_int modColor) {
    nel3dJNI.CTextureDLM_modulateAndfillRect565(swigCPtr, this, x, y, w, h, CRGBA.getCPtr(textMap), textMap, SWIGTYPE_p_unsigned_int.getCPtr(modColor));
  }

  public void modulateAndfillRect8888(long x, long y, long w, long h, CRGBA textMap, CRGBA modColor) {
    nel3dJNI.CTextureDLM_modulateAndfillRect8888(swigCPtr, this, x, y, w, h, CRGBA.getCPtr(textMap), textMap, CRGBA.getCPtr(modColor), modColor);
  }

  public void modulateConstantAndfillRect(long x, long y, long w, long h, CRGBA textMap, CRGBA modColor) {
    nel3dJNI.CTextureDLM_modulateConstantAndfillRect(swigCPtr, this, x, y, w, h, CRGBA.getCPtr(textMap), textMap, CRGBA.getCPtr(modColor), modColor);
  }

  public void releaseLightMap(long x, long y) {
    nel3dJNI.CTextureDLM_releaseLightMap(swigCPtr, this, x, y);
  }

}
